org.eclipse.vtp.desktop.projects.core.internals
Class MediaFile
java.lang.Object
org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
org.eclipse.vtp.desktop.projects.core.internals.MediaResource
org.eclipse.vtp.desktop.projects.core.internals.MediaFile
- All Implemented Interfaces:
- org.eclipse.core.runtime.IAdaptable, IMediaFile, IMediaResource, ObjectListener, IVoiceToolsResource
- Direct Known Subclasses:
- AudioFile, GrammarFile
public class MediaFile
- extends MediaResource
- implements IMediaFile
This is a concrete implementation of IMediaFile
and provides the default behavior of that interface.
- Version:
- 2.0
- Author:
- Trip Gilman
|
Constructor Summary |
MediaFile(IMediaContainer container,
org.eclipse.core.resources.IFile file)
Creates a new MediaFile in the given container
with the provided eclipse file resource. |
|
Method Summary |
org.eclipse.core.resources.IFile |
getUnderlyingFile()
|
long |
length()
Returns the length of this media resource in number of bytes. |
java.io.InputStream |
open()
Opens this media file resource and returns an InputStream
to it's contents. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
getAdapter |
MediaFile
public MediaFile(IMediaContainer container,
org.eclipse.core.resources.IFile file)
- Creates a new
MediaFile in the given container
with the provided eclipse file resource.
- Parameters:
container - The parent media containerfile - The eclipse file resource this media file represents
open
public java.io.InputStream open()
throws org.eclipse.core.runtime.CoreException
- Description copied from interface:
IMediaFile
- Opens this media file resource and returns an
InputStream
to it's contents.
- Specified by:
open in interface IMediaFile
- Returns:
- An input stream to the resource contents
- Throws:
org.eclipse.core.runtime.CoreException - If an error occured while opening the resource
length
public long length()
throws org.eclipse.core.runtime.CoreException
- Description copied from interface:
IMediaFile
- Returns the length of this media resource in number of bytes.
- Specified by:
length in interface IMediaFile
- Returns:
- The number of bytes contained in this resource
- Throws:
org.eclipse.core.runtime.CoreException - If an error occured while calculating the file
length
getUnderlyingFile
public org.eclipse.core.resources.IFile getUnderlyingFile()